<!DOCTYPE html>
<html>
  <head>
    <title>Flowy</title>

    <%= javascript_include_tag "application" %>
    <%= javascript_include_tag "task" %>
    <%= javascript_include_tag "flowy-bundle" %>

    <%= stylesheet_link_tag "zebra_datepicker", :media => :all %>
    <%= stylesheet_link_tag "od_button", :media => :all%>
    <%= stylesheet_link_tag "popup", :media => :all%>
    <%= stylesheet_link_tag "style", :media => :all %>

    <%= yield :head %>

    <%= csrf_meta_tags %>
  </head>
  <body>
    <div class="page">
      <div class="header page-inner">
        <div class="logo">
          <span class="logo-img"><strong>OopsData!</strong></span>
        </div>
        <div class="login-panel">
          <ul>
            <li id="sinaLi">
              <% if @current_user.try("[]", :access_token_weibo) %>
              <a class="sina login" href="javascript:void(0);" title="新浪微博"></a>
              <span class="pulldown-list">
                <span><a href="javascript:void(0);">退出微博</a></span>
                <span style="border:none"><a href="javascript:void(0);">取消授权</a></span>
              </span>
              <% else -%>
              <a class="sina" href="https://api.weibo.com/oauth2/authorize?client_id=<%= Oauth2::WEIBO_CLIENT_ID %>&response_type=code&redirect_uri=<%= Oauth2::WEIBO_CALLBACK_URL %>" title="新浪微博"></a>
              <% end -%>
            </li>
            <li>
              <% if @current_user.try("[]", :access_token_qq) == "admin" %>
              <a class="qq login" title="腾讯微博"></a>
              <span class="pulldown-list">
                <span><a href="javascript:void(0);">退出微博</a></span>
                <span style="border:none"><a href="javascript:void(0);">取消授权</a></span>
              </span>
              <% else -%>
              <a class="qq"  href="<%= Oauth2::TENCENT_ACCESS_URL %>" title="腾讯微博"></a>
              <% end -%>
            </li>
            <li>
              <% if @current_user.try("[]", :access_token_163) == "admin" %>
              <a class="wy login" href="javascript:void(0);" title="网易微博"></a>
              <span class="pulldown-list">
                <span><a href="javascript:void(0);">退出微博</a></span>
                <span style="border:none"><a href="javascript:void(0);">取消授权</a></span>
              </span>
              <% else -%>
              <a class="wy" href="javascript:void(0);" title="网易微博"></a>
              <% end -%>
            </li>
            <li>
              <% if @current_user.try("[]", :oops_role) == "admin" %>
              <a class="oops login" href="javascript:void(0);" title="Oopsdata"></a>
              <span class="pulldown-list">
                <span style="border:none"><a href="/summary">统计</a></span>
                <span style="border:none"><a href="/sns">账户管理</a></span>
                <span style="border:none"><a href="javascript:void(0);">取消授权</a></span>
              </span>
              <% else -%>
              <a class="oops" href="javascript:void(0);" title="Oopsdata"></a>
              <span class="pulldown-list" style="display:none">
                <span style="border:none"><a href="/summary">统计</a></span>
                <span style="border:none"><a href="/sns">账户管理</a></span>
                <span style="border:none"><a href="javascript:void(0);">取消授权</a></span>
              </span>
              <% end -%>

            </li>
          </ul>
        </div>
      </div>
      <div class="search-panel">
        <div class="flowy-logo"><strong>flowy</strong></div>
        <div class="search">
          <input type="text" autofocus placeholder="输入 回车搜索">
          <a href="javascript:void(0);" class="search-btn">搜 索</a>
          <!-- 搜索引擎切换 -->
          <div id="search-engine">
            <i class="divide"></i>
            <div class="engine-toggle">新浪微博 <i class="triangle"></i></div>
            <div class="eng-list" style="display:none">
                <a class="t-tencent t-label" data="Tencent" href="javascript:void(0);">腾讯微博</a>
                <a class="t-163 t-label"  data="163" href="javascript:void(0);">网易微博</a>
                <a class="t-sohu t-label" data="Sohu" href="javascript:void(0);">搜狐微博</a>
                <a style="border-bottom:1px #ccc solid" data="Weibo" class="t-sina t-label" href="javascript:void(0);">新浪微博</a>
            </div>
          </div>
        </div>
      </div>
    </div>
    <%= yield %>
    <%= render "layouts/footer" %>

    <%= yield :nav %>
  </body>
</html>